package org.jod.anarchytrek.componentfactory;

import java.util.HashMap;
import java.util.Map;

import org.jod.anarchytrek.AComponent;
import org.jod.anarchytrek.component.Nacelle;
import org.jod.anarchytrek.component.WarpDrive;
import org.jod.anarchytrek.info.NacelleInfo;
import org.jod.anarchytrek.info.WarpDriveInfo;

public class NacelleFactory extends AComponentFactory {

    private Map _infoComponents;
    private Map _components;
    private String _nacelleType;
    private Map _mapClass;

    public NacelleFactory(Map aInfoComponents, Map aComponents, String aNacelleType) {
        
        _infoComponents = aInfoComponents;
        _components = aComponents;
        _nacelleType = aNacelleType;

        _mapClass = new HashMap();

        
        NacelleClass aClass = null;
        
        aClass = new NacelleClass();
        aClass.name("Type1");
        aClass.structuralUnits(5);
        aClass.sustainableWarp(1.2);
        aClass.fullWarp(1.2);
       _mapClass.put("Type1", aClass);
       
       
       aClass = new NacelleClass();
       aClass.name("Type2");
       aClass.structuralUnits(15);
       aClass.sustainableWarp(3);
       aClass.fullWarp(5);
      _mapClass.put("Type2", aClass);

      aClass = new NacelleClass();
      aClass.name("Type3");
      aClass.structuralUnits(20);
      aClass.sustainableWarp(3);
      aClass.fullWarp(6);
     _mapClass.put("Type3", aClass);

     aClass = new NacelleClass();
     aClass.name("Type4");
     aClass.structuralUnits(25);
     aClass.sustainableWarp(4);
     aClass.fullWarp(7);
    _mapClass.put("Type4", aClass);    

    aClass = new NacelleClass();
    aClass.name("Type5");
    aClass.structuralUnits(50);
    aClass.sustainableWarp(6);
    aClass.fullWarp(7);
   _mapClass.put("Type5", aClass);    

   aClass = new NacelleClass();
   aClass.name("Type6");
   aClass.structuralUnits(80);
   aClass.sustainableWarp(7);
   aClass.fullWarp(8);
  _mapClass.put("Type6", aClass);
  
  
  aClass = new NacelleClass();
  aClass.name("Type7");
  aClass.structuralUnits(120);
  aClass.sustainableWarp(8);
  aClass.fullWarp(9);
 _mapClass.put("Type7", aClass);
   
    }
    
    public void build() {
   
        NacelleInfo nacelleInfo = new NacelleInfo();
        _infoComponents.put(AComponent.NACELLE, nacelleInfo);
        NacelleClass aClass = (NacelleClass)_mapClass.get(_nacelleType);
        _components.put(AComponent.NACELLE, new Nacelle(nacelleInfo ,  aClass ));
        
        
    }

}
